<div class="problemindexholder" problemindex="C">
 <div class="ttypography">
  <div class="problem-statement">
   <div class="header">
    <div class="title">
     C. Square Subsets
    </div>
    <div class="time-limit">
     <div class="property-title">
      time limit per test
     </div>
     4 seconds
    </div>
    <div class="memory-limit">
     <div class="property-title">
      memory limit per test
     </div>
     256 megabytes
    </div>
    <div class="input-file">
     <div class="property-title">
      input
     </div>
     standard input
    </div>
    <div class="output-file">
     <div class="property-title">
      output
     </div>
     standard output
    </div>
   </div>
   <div>
    <p>
     Petya was late for the lesson too. The teacher gave him an additional task. For some array
     <span class="tex-span">
      <i>
       a
      </i>
     </span>
     Petya should find the number of different ways to select non-empty subset of elements from it in such a way that their product is equal to a square of some integer.
    </p>
    <p>
     Two ways are considered different if sets of indexes of elements chosen by these ways are different.
    </p>
    <p>
     Since the answer can be very large, you should find the answer modulo
     <span class="tex-span">
      10
      <sup class="upper-index">
       9
      </sup>
      + 7
     </span>
     .
    </p>
   </div>
   <div class="input-specification">
    <div class="section-title">
     Input
    </div>
    <p>
     First line contains one integer
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       n
      </i>
      ≤ 10
      <sup class="upper-index">
       5
      </sup>
     </span>
     ) — the number of elements in the array.
    </p>
    <p>
     Second line contains
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     integers
     <span class="tex-span">
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≤ 70
     </span>
     ) — the elements of the array.
    </p>
   </div>
   <div class="output-specification">
    <div class="section-title">
     Output
    </div>
    <p>
     Print one integer — the number of different ways to choose some elements so that their product is a square of a certain integer modulo
     <span class="tex-span">
      10
      <sup class="upper-index">
       9
      </sup>
      + 7
     </span>
     .
    </p>
   </div>
   <div class="sample-tests">
    <div class="section-title">
     Examples
    </div>
    <div class="sample-test">
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>4<br/>1 1 1 1<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>15<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>4<br/>2 2 2 2<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>7<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>5<br/>1 2 4 5 8<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>7<br/></pre>
     </div>
    </div>
   </div>
   <div class="note">
    <div class="section-title">
     Note
    </div>
    <p>
     In first sample product of elements chosen by any way is
     <span class="tex-span">
      1
     </span>
     and
     <span class="tex-span">
      1 = 1
      <sup class="upper-index">
       2
      </sup>
     </span>
     . So the answer is
     <span class="tex-span">
      2
      <sup class="upper-index">
       4
      </sup>
      - 1 = 15
     </span>
     .
    </p>
    <p>
     In second sample there are six different ways to choose elements so that their product is
     <span class="tex-span">
      4
     </span>
     , and only one way so that their product is
     <span class="tex-span">
      16
     </span>
     . So the answer is
     <span class="tex-span">
      6 + 1 = 7
     </span>
     .
    </p>
   </div>
  </div>
  <p>
  </p>
 </div>
</div>
